package com.lgit.Model4.hw05;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

public class ServiceTest {

    public static void main(String[] args) {
        List<Socket> list = new ArrayList<>();
        ServerSocket ss = null;
        Socket s = null;
        try {
            ss = new ServerSocket(1220);
            System.out.println("欢迎来到拉勾聊天室...");
            while (true) {
                s = ss.accept();
                list.add(s);
                new Thread(new ServerThread(s, list)).start();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
